FROM php:5.6.33-fpm

# PHP extensions
RUN DEBIAN_FRONTEND=noninteractive apt-get update -q && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y \
        nano openssl libldb-dev libtidy-dev libgmp-dev \
        libicu-dev \
        libmcrypt-dev \
        libcurl4-openssl-dev \
        librabbitmq-dev \
        libsodium-dev \
        libpq-dev \
        libxslt1-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        zlib1g-dev \
        libgmp3-dev \
        libbz2-dev \
        libgmp-dev \
        libgmp3-dev

RUN apt-get install -y libmagickwand-6.q16-dev --no-install-recommends \
    && ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/MagickWand-config /usr/bin \
    && pecl install imagick \
    && echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini

RUN docker-php-ext-configure xsl \
    && docker-php-ext-configure soap --enable-soap \
    && docker-php-ext-configure intl --enable-intl \
    && docker-php-ext-configure pcntl --enable-pcntl \
	&& docker-php-ext-configure bcmath --enable-bcmath \
    && docker-php-ext-configure pdo_mysql --with-pdo-mysql \
    && docker-php-ext-configure mbstring --enable-mbstring \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && docker-php-ext-install dba calendar ctype dom tokenizer fileinfo gettext posix tidy wddx \
    && docker-php-ext-install exif sockets bz2 zip iconv mcrypt json session \
    && docker-php-ext-install opcache xsl xml xmlreader xmlwriter xmlrpc simplexml \
    && docker-php-ext-install curl bcmath intl pcntl mbstring soap mysql mysqli pdo pdo_mysql \
    && ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
    && docker-php-ext-install gmp sysvmsg sysvsem sysvshm \
    && docker-php-ext-enable soap 
